import instence from "@/utils/axios/index";

export interface IRegister {
  code: string;
  confirmPassword: string;
  email: string;
  password: string;
  username: string;
}

export interface ILogin {
  username?: string;
  password?: string;
  email?: string;
  code?: string;
}

export const sendEmailApi = (data: { email: string }) => {
  return instence.get("email/send", {
    params: data,
  });
};

export const registerApi = (data: IRegister) => {
  return instence.post("auth/register", data);
};

export const loginApi = (data: ILogin) => {
  return instence.post("auth/login", data);
};
